<?php
// events list page
require_once 'view/adm/calendar/events.index.php';
require_once 'model/common/session.php';


class EventsIndexPage extends PageController {

	var $form;

    function EventsIndexPage() {
        parent::PageController();

        $this->form =& new FormController();
        $this->form->addChild('apply', new ButtonController(new Delegate($this, 'apply')));
        $this->form->setDefaultChild('apply');

        	$this->form->addRule(new Handle('NumericRangeRule', array('event_id',0)));


        $this->addChild('FilterForm', $this->form);
        $this->setDefaultChild('FilterForm');
        $this->setDefaultView(new Handle('EventsListView', array('/adm/calendar/events.index.html')));

        $this->addView('success', WACT_DEFAULT_VIEW);
        $this->addView('notfound', WACT_DEFAULT_VIEW);
        $this->addView('delete', new Handle('RedirectView', array('/delete')));
        $this->addView('publish', new Handle('RedirectView', array('/publish')));
        $this->addView('deny', new Handle('RedirectView', array('/deny')));
        //$this->addView('viewnext', new Handle('RedirectView', array('/viewnext')));
        $this->addView('this', WACT_DEFAULT_VIEW);
        $this->addView('index', new Handle('RedirectView', array('/')));


    }

    //apply filter
    //save filter response model into session
    function apply(&$source, &$request, &$responseModel) {
    	Session::saveResponseModel($responseModel,'filter.events');
    }

}

?>